\newproblem{lay:7_1_23}{
  % Problem identification
	\begin{large}
	  \hspace{\fill}\newline
    \textbf{Lay, 7.1.23}
	\end{large}
	\\
  \ifthenelse{\boolean{identifyAuthor}}{\textit{Carlos Oscar Sorzano, Aug. 31st, 2013} \\}{}

  % Problem statement
	Let $A=\begin{pmatrix} 3 & 1 & 1\\ 1& 3 & 1\\ 1 & 1 & 3 \end{pmatrix}$ and $\mathbf{u}=\begin{pmatrix}1\\1\\1\end{pmatrix}$. Verify that 5 is an
	eigenvalue of $A$ and $\mathbf{u}$ is its eigenvector. Then, orthogonally diagonalize $A$.
}{
   % Solution
	Let's verify that $\mathbf{u}$ is an eigenvector of $A$
	\begin{center}
		$A\mathbf{u}=\begin{pmatrix} 3 & 1 & 1\\ 1& 3 & 1\\ 1 & 1 & 3 \end{pmatrix}\begin{pmatrix}1\\1\\1\end{pmatrix}=\begin{pmatrix}5\\5\\5\end{pmatrix}=
		   5\begin{pmatrix}1\\1\\1\end{pmatrix}$
	\end{center}
	The other two vectors needed to orthogonally diagonalize $A$ must be orthogonal to $\mathbf{u}$, let's call them $\mathbf{v}$ and $\mathbf{w}$. They must meet
	\begin{center}
		$\mathbf{u}\cdot\mathbf{v}=(1,1,1)\cdot\mathbf{v}=v_1+v_2+v_3=0 \Rightarrow v_3=-v_1-v_2$ \\
		$\mathbf{u}\cdot\mathbf{w}=(1,1,1)\cdot\mathbf{w}=w_1+w_2+w_3=0 \Rightarrow w_3=-w_1-w_2$ \\
	\end{center}
	Additionally, they must be orthogonal to each other so
	\begin{center}
		$\mathbf{v}\cdot\mathbf{w}=(v_1,v_2,-v_1-v_2)\cdot(w_1,w_2,-w_1-w_2)=2v_1w_1+2v_2w_2+v_1w_2+v_2w_1=0$ \\
		$2v_1w_1+(2v_2+v_1)w_2+v_2w_1=0$\\
		$w_2=-\frac{2v_1w_1+v_2w_1}{2v_2+v_1}$
	\end{center}
	So the two vectors must be of the form
	\begin{center}
		$\mathbf{v}=(v_1,v_2,-v_1-v_2)$ \\
		$\mathbf{w}=(w_1,-\frac{2v_1w_1+v_2w_1}{2v_2+v_1},-w_1+\frac{2v_1w_1+v_2w_1}{2v_2+v_1})$ \\
	\end{center}
	Giving the values $v_1=1$, $v_2=0$, and $w_1=1$, we get
	\begin{center}
		$\mathbf{v}=(1,0,-1)$ \\
		$\mathbf{w}=(1,-2,1)$ \\
	\end{center}
	The eigenvalue associated to these eigenvectors are 2 and 2 because
	\begin{center}
		$A\mathbf{v}=\begin{pmatrix} 3 & 1 & 1\\ 1& 3 & 1\\ 1 & 1 & 3 \end{pmatrix}\begin{pmatrix}1\\0\\-1\end{pmatrix}=\begin{pmatrix}2\\0\\-2\end{pmatrix}=
		   2\begin{pmatrix}1\\0\\-1\end{pmatrix}$ \\
		$A\mathbf{w}=\begin{pmatrix} 3 & 1 & 1\\ 1& 3 & 1\\ 1 & 1 & 3 \end{pmatrix}\begin{pmatrix}1\\-2\\1\end{pmatrix}=\begin{pmatrix}2\\-4\\2\end{pmatrix}=
		   2\begin{pmatrix}1\\-2\\1\end{pmatrix}$ \\
	\end{center}
	For an orthogonal diagonalization we need the vectors to be unitary so, we normalize them
	\begin{center}
		$\mathbf{u}'=\frac{1}{\|\mathbf{u}\|}\mathbf{u}=\frac{1}{\sqrt{3}}(1,1,1)$ \\
		$\mathbf{v}'=\frac{1}{\|\mathbf{v}\|}\mathbf{v}=\frac{1}{\sqrt{2}}(1,0,-1)$ \\
		$\mathbf{w}'=\frac{1}{\|\mathbf{w}\|}\mathbf{w}=\frac{1}{\sqrt{6}}(1,-2,1)$ \\
	\end{center}
	Finally, the orthogonal diagonalization of $A$ is $A=PDP^T$ with
	\begin{center}
	   $P=\begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}\\
		    \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \end{pmatrix}$ and
		 $D=\begin{pmatrix} 5 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 2\end{pmatrix}$ 
	\end{center}
}
\useproblem{lay:7_1_23}
\ifthenelse{\boolean{eachProblemInOnePage}}{\newpage}{}

